var HOME = HOME || {};

HOME.initPage = function(){
	/*register event handler*/
			$('.maindoor').each(function(){
				var OUT = -2,
				IN  =  2;
				var status = 0;
				var that = $(this);
				$(this).hover(function(){
					status = IN;
					that.find('img:eq(2)').animate({left:'-300px'},{queue:false,duration:250, 
					complete:function(){
						if(status >= 0){
							--status;
							that.find('img:eq(0)').animate({top:'-230px'},{queue:false,duration:250});
						}
					}});
					that.find('img:eq(3)').animate({left:'600px'},{queue:false,duration:250, 
					complete:function(){
						if(status >= 0){
							--status;
							that.find('img:eq(1)').animate({top:'400px'},{queue:false,duration:250});
						}
					}});
				},function(){
					status = OUT
					that.find('img:eq(0)').animate({top:'0px'},{queue:false,duration:250,
					complete:function(){
						if(status <= 0){
							++status;
							that.find('img:eq(2)').animate({left:'0px'},{queue:false,duration:250});
						}
					}});
					that.find('img:eq(1)').animate({top:'230px'},{queue:false,duration:250,
					complete:function(){
						if(status <= 0){
							that.find('img:eq(3)').animate({left:'300px'},{queue:false,duration:250});
						}
					}});
				});
			
			});
	/*init HOME variable*/
}

HOME.showPage = function(){
	$("#menucontent").children().hide();
	$("#maincontent").show();

}